package cn.cvs.controller;

import cn.cvs.pojo.SysUser;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

import java.util.Map;

@Controller
@RequestMapping(value = "/hello")
public class HelloController {
    Logger logger = Logger.getLogger(HelloController.class);

    @RequestMapping(value = {"/hello","/hello2"})
    public ModelAndView hello(@RequestParam String realName) throws Exception {
        logger.info("您好" + realName + "欢迎来到Spring MVC课堂。");
        ModelAndView mv = new ModelAndView();
        mv.addObject("realName", realName);
        mv.setViewName("hello");
        //跳转到hello页面
        return mv;
    }


}
